//
//  CommonTools.swift
//  weibo
//
//  Created by Limonwei on 15/12/5.
//  Copyright © 2015年 heima. All rights reserved.
//

//公共的工具类

import UIKit

//屏幕宽度与屏幕高度
let SCREENW = UIScreen.mainScreen().bounds.size.width
let SCREENH = UIScreen.mainScreen().bounds.size.height

//切换根控制器的通知
let LBWSwitchRootVCNotifation = "LBWSwitchRootVCNotifation"

//表情点击发送的通知
let LBWEmoticonButtonDidSelectedNotification = "LBWEmoticonButtonDidSelectedNotification"

//表情删除按钮点击的通知
let LBWMDeleteButtonDidSelectedNotification = "LBWMDeleteButtonDidSelectedNotification"

//快速创建一个颜色

func RGB(red red: CGFloat, green: CGFloat, blue: CGFloat) ->UIColor{
    
    return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: 1)
}


//随机颜色

func RandomColor() -> UIColor {
    
    return RGB(red: CGFloat(random() % 256), green: CGFloat(random() % 256), blue: CGFloat(random() % 256))
}


//自定的log
//在 BuildSettting 中 搜索 other swift flags 添加一个 `-D DEBUG`

func printLog(message: Any, file:String = __FILE__, line:Int = __LINE__, mthName:String = __FUNCTION__){
    
    #if DEBUG
    
        __LINE__
        print("\((file as NSString).lastPathComponent)[\(line)], \(mthName): \(message)")
    #endif

}


















